package com.wipz.eoa.iphone;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import com.wipz.eoa.iphone.util.DataUtil;

/**
 * 
 * @author Biqing Zeng
 * @date 2012-1-13 ����05:48:23
 */
public class BaseDaoImpl extends SqlSessionDaoSupport implements IBaseDao {
	
	@Override
	public int delete(String exeName, Object obj) {
		return getSqlSession().delete(exeName, obj);
	}

	@Override
	public int insert(String exeName, Object obj) {
		return getSqlSession().insert(exeName, obj);
	}

	@Override
	public List queryList(String exeName, Object obj) {
		return getSqlSession().selectList(exeName, obj);
	}

	@Override
	public Object queryOne(String exeName, Object obj) {
		Object o = getSqlSession().selectOne(exeName, obj);
		if(o !=  null) {
			if (o instanceof Map) {
			o = DataUtil.filterClob(o);
			}
		}
		return o;
	}

	@Override
	public int update(String exeName, Object obj) {
		return getSqlSession().update(exeName, obj);
	}

	@Override
	public int deleteByIdAndUserCode(String exeName, Map map) {
		return getSqlSession().delete(exeName, map);
	}


}
